/**
 * @filename:InspectDetailController Jan 21, 2025
 * @project Wonder Vue Admin Api  1.1.0
 * Copyright(c) 2020 Wonder Co. Ltd. 
 * All right reserved. 
 */
package com.wonder.api.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.wonder.app.domain.InspectDetail;
import com.wonder.app.service.InspectDetailService;
import com.wonder.app.request.InspectDetailRequest;
import com.wonder.common.common.AjaxMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wonder.common.common.AjaxResult;
import com.wonder.common.utils.ThreadLocalUtil;
import com.wonder.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParam;
/**   
 * 
 * <p>说明： 来料检验单详情API接口层</P>
 * @version: 1.1.0
 * @author: Wonder
 * @time    Jan 21, 2025
 *
 */
@Api(tags = "来料检验单详情")
@RestController
@RequestMapping("/app/InspectDetail")
public class InspectDetailController {
	
	@Autowired
	private InspectDetailService inspectDetailService;
	
	
	/**
	 * @explain 获取轮播图
	 * @param   lang：语言
	 * @param   namePrefix：参数名字前缀
	 * @return  Map<String,Object>
	 * @author  Wonder
	 */
	@ApiOperation(value = "获取轮播图")
	@RequestMapping(value = "/getBanners", method = RequestMethod.GET)
	public Map<String,Object> getBanners(@RequestParam( ) String lang, @RequestParam(defaultValue="app.home.banner",  required=false) String namePrefix) {
        
//        if(!StringUtils.hasText(lang)) return AjaxMap.failed("system.parameterError");
//	    List<Map<String, Object>> bannList=parameterService.getBanners(lang,namePrefix);
//return AjaxMap.success("data", bannList);
		return null;
	}
	
	
	/**
	 * @explain 获取参数信息
	 * @param   keys：参数名列表
	 * @return  Map<String,Object>
	 * @author  Wonder
	 */
	@ApiOperation(value = "获取参数信息")
	@RequestMapping(value = "/getParameters", method = RequestMethod.POST)
	public Map<String,Object> getParameters(@RequestParam( ) String keys) {
//
//        if(!StringUtils.hasText(keys)) return AjaxMap.failed("system.parameterError");
//	    return AjaxMap.success(parameterService.getParameterByKeyString(keys));
		return null;
	}
	
	/**
	 * @explain 获取来料检验单详情列表
	 * @return  Map<String,Object>
	 * @author  Wonder
	 */
	@ApiOperation(value = "获取来料检验单详情列表")
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	public AjaxResult<Object> list() {
	    if(ThreadLocalUtil.get("uid")==null)
			return AjaxResult.unauthorized();
		Long uid=Long.parseLong(ThreadLocalUtil.get("uid").toString());
        return AjaxResult.success(inspectDetailService.list(new QueryWrapper<InspectDetail>().eq("uid", uid).orderByDesc("id")));
	    
	}	
	
}